package xin.lms.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import xin.core.jpa.JpaConstant;
import xin.core.jpa.model.UUIDEntity;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <pre>
 * Quartz Job Log
 * </pre>
 *
 * @author lixin@outlook.com
 * @version 1.0
 * @since 2018/1/12 9:09
 */
@Entity
@Table(name = "sys_job_log")
@Data
@ToString
@EqualsAndHashCode(callSuper = true)
@Builder
public class JobLog extends UUIDEntity implements Serializable {

    /**
     * JOB实例ID
     */
    @ApiModelProperty(value = "JOB实例ID")
    @Column(name = "job_instance_id", length = JpaConstant.CommonStringLength)
    private String jobnstanceId;

    /**
     * 任务名称
     */
    @ApiModelProperty(value = "Job名称")
    @Column(name = "job_name", length = JpaConstant.CommonStringLargeLength)
    private String jobName;

    /**
     * Job分组
     */
    @ApiModelProperty(value = "Job分组")
    @Column(name = "job_group", length = JpaConstant.CommonStringLargeLength)
    private String jobGroup;

    /**
     * 开始时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间")
    @Column(name = "start_time")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间")
    @Column(name = "ent_time")
    private LocalDateTime entTime;

    /**
     * 成功
     */
    @ApiModelProperty(value = "成功")
    @Column(name = "success")
    private Boolean success;

    /**
     * 备用字段
     */
    @ApiModelProperty(value = "备用字段")
    @Column(name = "remark", length = JpaConstant.DescriptionColumnLength)
    private String remark;
}